package com.mj.haier.calc.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import org.springframework.data.elasticsearch.annotations.Document;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;

/**
 * The AzEncourage entity.
 * 安装单激励订单信息
 * @author ycm
 */
@ApiModel(description = "The AzEncourage entity. 安装单激励订单信息 @author ycm")
@Entity
@Table(name = "az_encourage")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "azencourage")
public class AzEncourage implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    /**
     * 激励单号，标识唯一
     */
    
    @ApiModelProperty(value = "激励单号，标识唯一")
    @Column(name = "encourage_id", unique = true)
    @NotBlank(message = "[encourageId]激励单号必须")
    private String encourageId;

    /**
     * 订单类型
     */
    @ApiModelProperty(value = "订单类型")
    @Column(name = "product_type")
    private String productType;

    /**
     * 激励金额，单位元
     */
    @ApiModelProperty(value = "激励金额，单位元")
    @Column(name = "encourage_amounts")
    @NotBlank(message = "[encourageAmounts]激励金额必须，单位元")
    @Pattern(regexp = "((-)?[1-9]\\d*\\.?\\d*)|((-)?0\\.\\d*[1-9])",message = "[encourageAmounts]激励金额必须为数字,不可为0,单位元")
    private String encourageAmounts;

    /**
     * 激励描述
     */
    @ApiModelProperty(value = "激励描述")
    @Column(name = "encourage_desc")
    @NotBlank(message = "[encourageDesc]激励描述必须")
    private String encourageDesc;

    /**
     * 激励录入时间
     */
    @ApiModelProperty(value = "激励录入时间")
    @Column(name = "encourage_import_date")
    private Instant encourageImportDate;

    /**
     * 激励录入人
     */
    @ApiModelProperty(value = "激励录入人")
    @Column(name = "encourage_create")
    @NotBlank(message = "[encourageCreate]激励录入人必须")
    private String encourageCreate;

    /**
     * 激励分类, 固定为JLGM/ JLCY/ JLJD/ JLTM
     */
    @ApiModelProperty(value = "激励分类, 固定为JLGM/ JLCY/ JLJD/ JLTM")
    @Column(name = "encourage_type")
    @NotBlank(message = "[encourageType]激励分类必须，固定为JLGM/ JLCY/ JLJD/ JLTM")
    private String encourageType;

    /**
     * 激励小类，后续产业下分小类
     */
    @ApiModelProperty(value = "激励小类，后续产业下分小类")
    @Column(name = "encourage_second_type")
    private String encourageSecondType;

    /**
     * 预算体
     */
    @ApiModelProperty(value = "预算体")
    @Column(name = "encourage_budget")
    @NotBlank(message = "[encourageBudget]预算体必须")
    private String encourageBudget;

    /**
     * 判责大类
     */
    @ApiModelProperty(value = "判责大类")
    @Column(name = "responsibility_class")
    private String responsibilityClass;

    /**
     * 判责小类
     */
    @ApiModelProperty(value = "判责小类")
    @Column(name = "responsibility_small_class")
    private String responsibilitySmallClass;

    /**
     * 判责时间
     */
    @ApiModelProperty(value = "判责时间")
    @Column(name = "responsibility_time")
    private String responsibilityTime;

    /**
     * 工贸编码
     */
    @ApiModelProperty(value = "工贸编码")
    @Column(name = "trade_code")
    @NotBlank(message = "[tradeCode]工贸编码必须")
    private String tradeCode;

    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号")
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 订单号（PJ）
     */
    @ApiModelProperty(value = "订单号（PJ）")
    @Column(name = "pj_order_code")
    private String pjOrderCode;

    /**
     * 来源单号
     */
    @ApiModelProperty(value = "来源单号")
    @Column(name = "source_order_code")
    private String sourceOrderCode;

    /**
     * 原单号
     */
    @ApiModelProperty(value = "原单号")
    @Column(name = "original_order_code")
    private String originalOrderCode;

    /**
     * 订单产业编码, 会验证当前末级小微存在
     */
    @ApiModelProperty(value = "订单产业编码, 会验证当前末级小微存在")
    @Column(name = "source_name_code")
    @NotBlank(message = "[sourceNameCode]订单产业编码必须")
    private String sourceNameCode;

    /**
     * 激励兑现首要对象， 应为车队ID
     */
    @ApiModelProperty(value = "激励兑现首要对象， 应为车队ID")
    @Column(name = "encourage_object")
    @NotBlank(message = "[encourageObject]激励兑现首要对象必须，应为车队86码")
    private String encourageObject;

    /**
     * 激励兑现次要对象， 应为司机ID
     */
    @ApiModelProperty(value = "激励兑现次要对象， 应为司机ID")
    @Column(name = "encourage_second_object")
    private String encourageSecondObject;

    /**
     * 激励兑现次要对象兑现比例，范围为0 -100
     */
    @ApiModelProperty(value = "激励兑现次要对象兑现比例，范围为0 -100")
    @Column(name = "proportion")
    @Min(0)
    @Max(100)
    private Integer proportion = 0;

    /**
     * 标识激励来源系统， CDK，其他等
     */
    @ApiModelProperty(value = "标识激励来源系统， CDK，其他等")
    @Column(name = "source_system")
    @NotBlank(message = "[sourceSystem]标识激励来源系统， CDK，其他等")
    private String sourceSystem;

    /**
     * 网点86码
     */
    @ApiModelProperty(value = "网点86码")
    @Column(name = "netpoint")
    private String netpoint;

    /**
     * 激励兑现首要对象兑现状态， 0：未兑现； 1： 全兑现； 2： 部分兑现
     */
    @ApiModelProperty(value = "激励兑现首要对象兑现状态， 0：未兑现； 1： 全兑现； 2： 部分兑现")
    @Column(name = "settle_state")
    private String settleState;

    /**
     * 激励兑现次要对象兑现状态， 0：未兑现； 1： 全兑现； 2： 部分兑现
     */
    @ApiModelProperty(value = "激励兑现次要对象兑现状态， 0：未兑现； 1： 全兑现； 2： 部分兑现")
    @Column(name = "second_settle_state")
    private String secondSettleState;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Column(name = "remark")
    private String remark;

    @Column(name = "gmt_modified")
    private Instant gmtModified;

    @Column(name = "modified_user")
    private String modifiedUser;

    @Column(name = "gmt_create")
    private Instant gmtCreate;

    @Column(name = "create_user")
    private String createUser;

    /**
     * 备用字段 add1
     */
    @ApiModelProperty(value = "备用字段 add1")
    @Column(name = "add_1")
    private String add1;

    /**
     * 备用字段 add2
     */
    @ApiModelProperty(value = "备用字段 add2")
    @Column(name = "add_2")
    private String add2;

    /**
     * 备用字段 add3
     */
    @ApiModelProperty(value = "备用字段 add3")
    @Column(name = "add_3")
    private String add3;

    /**
     * 备用字段 add4
     */
    @ApiModelProperty(value = "备用字段 add4")
    @Column(name = "add_4")
    private String add4;

    /**
     * 备用字段 add5
     */
    @ApiModelProperty(value = "备用字段 add5")
    @Column(name = "add_5")
    private String add5;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public AzEncourage id(Long id){
        this.id = id;
        return this;
    }

    public String getEncourageId() {
        return encourageId;
    }

    public AzEncourage encourageId(String encourageId) {
        this.encourageId = encourageId;
        return this;
    }

    public void setEncourageId(String encourageId) {
        this.encourageId = encourageId;
    }

    public String getProductType() {
        return productType;
    }

    public AzEncourage productType(String productType) {
        this.productType = productType;
        return this;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public String getEncourageAmounts() {
        return encourageAmounts;
    }

    public AzEncourage encourageAmounts(String encourageAmounts) {
        this.encourageAmounts = encourageAmounts;
        return this;
    }

    public void setEncourageAmounts(String encourageAmounts) {
        this.encourageAmounts = encourageAmounts;
    }

    public String getEncourageDesc() {
        return encourageDesc;
    }

    public AzEncourage encourageDesc(String encourageDesc) {
        this.encourageDesc = encourageDesc;
        return this;
    }

    public void setEncourageDesc(String encourageDesc) {
        this.encourageDesc = encourageDesc;
    }

    public Instant getEncourageImportDate() {
        return encourageImportDate;
    }

    public AzEncourage encourageImportDate(Instant encourageImportDate) {
        this.encourageImportDate = encourageImportDate;
        return this;
    }

    public void setEncourageImportDate(Instant encourageImportDate) {
        this.encourageImportDate = encourageImportDate;
    }

    public String getEncourageCreate() {
        return encourageCreate;
    }

    public AzEncourage encourageCreate(String encourageCreate) {
        this.encourageCreate = encourageCreate;
        return this;
    }

    public void setEncourageCreate(String encourageCreate) {
        this.encourageCreate = encourageCreate;
    }

    public String getEncourageType() {
        return encourageType;
    }

    public AzEncourage encourageType(String encourageType) {
        this.encourageType = encourageType;
        return this;
    }

    public void setEncourageType(String encourageType) {
        this.encourageType = encourageType;
    }

    public String getEncourageSecondType() {
        return encourageSecondType;
    }

    public AzEncourage encourageSecondType(String encourageSecondType) {
        this.encourageSecondType = encourageSecondType;
        return this;
    }

    public void setEncourageSecondType(String encourageSecondType) {
        this.encourageSecondType = encourageSecondType;
    }

    public String getEncourageBudget() {
        return encourageBudget;
    }

    public AzEncourage encourageBudget(String encourageBudget) {
        this.encourageBudget = encourageBudget;
        return this;
    }

    public void setEncourageBudget(String encourageBudget) {
        this.encourageBudget = encourageBudget;
    }

    public String getResponsibilityClass() {
        return responsibilityClass;
    }

    public AzEncourage responsibilityClass(String responsibilityClass) {
        this.responsibilityClass = responsibilityClass;
        return this;
    }

    public void setResponsibilityClass(String responsibilityClass) {
        this.responsibilityClass = responsibilityClass;
    }

    public String getResponsibilitySmallClass() {
        return responsibilitySmallClass;
    }

    public AzEncourage responsibilitySmallClass(String responsibilitySmallClass) {
        this.responsibilitySmallClass = responsibilitySmallClass;
        return this;
    }

    public void setResponsibilitySmallClass(String responsibilitySmallClass) {
        this.responsibilitySmallClass = responsibilitySmallClass;
    }

    public String getResponsibilityTime() {
        return responsibilityTime;
    }

    public AzEncourage responsibilityTime(String responsibilityTime) {
        this.responsibilityTime = responsibilityTime;
        return this;
    }

    public void setResponsibilityTime(String responsibilityTime) {
        this.responsibilityTime = responsibilityTime;
    }

    public String getTradeCode() {
        return tradeCode;
    }

    public AzEncourage tradeCode(String tradeCode) {
        this.tradeCode = tradeCode;
        return this;
    }

    public void setTradeCode(String tradeCode) {
        this.tradeCode = tradeCode;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public AzEncourage orderCode(String orderCode) {
        this.orderCode = orderCode;
        return this;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getPjOrderCode() {
        return pjOrderCode;
    }

    public AzEncourage pjOrderCode(String pjOrderCode) {
        this.pjOrderCode = pjOrderCode;
        return this;
    }

    public void setPjOrderCode(String pjOrderCode) {
        this.pjOrderCode = pjOrderCode;
    }

    public String getSourceOrderCode() {
        return sourceOrderCode;
    }

    public AzEncourage sourceOrderCode(String sourceOrderCode) {
        this.sourceOrderCode = sourceOrderCode;
        return this;
    }

    public void setSourceOrderCode(String sourceOrderCode) {
        this.sourceOrderCode = sourceOrderCode;
    }

    public String getOriginalOrderCode() {
        return originalOrderCode;
    }

    public AzEncourage originalOrderCode(String originalOrderCode) {
        this.originalOrderCode = originalOrderCode;
        return this;
    }

    public void setOriginalOrderCode(String originalOrderCode) {
        this.originalOrderCode = originalOrderCode;
    }

    public String getSourceNameCode() {
        return sourceNameCode;
    }

    public AzEncourage sourceNameCode(String sourceNameCode) {
        this.sourceNameCode = sourceNameCode;
        return this;
    }

    public void setSourceNameCode(String sourceNameCode) {
        this.sourceNameCode = sourceNameCode;
    }

    public String getEncourageObject() {
        return encourageObject;
    }

    public AzEncourage encourageObject(String encourageObject) {
        this.encourageObject = encourageObject;
        return this;
    }

    public void setEncourageObject(String encourageObject) {
        this.encourageObject = encourageObject;
    }

    public String getEncourageSecondObject() {
        return encourageSecondObject;
    }

    public AzEncourage encourageSecondObject(String encourageSecondObject) {
        this.encourageSecondObject = encourageSecondObject;
        return this;
    }

    public void setEncourageSecondObject(String encourageSecondObject) {
        this.encourageSecondObject = encourageSecondObject;
    }

    public Integer getProportion() {
        return proportion;
    }

    public AzEncourage proportion(Integer proportion) {
        this.proportion = proportion;
        return this;
    }

    public void setProportion(Integer proportion) {
        this.proportion = proportion;
    }

    public String getSourceSystem() {
        return sourceSystem;
    }

    public AzEncourage sourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
        return this;
    }

    public void setSourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
    }

    public String getNetpoint() {
        return netpoint;
    }

    public AzEncourage netpoint(String netpoint) {
        this.netpoint = netpoint;
        return this;
    }

    public void setNetpoint(String netpoint) {
        this.netpoint = netpoint;
    }

    public String getSettleState() {
        return settleState;
    }

    public AzEncourage settleState(String settleState) {
        this.settleState = settleState;
        return this;
    }

    public void setSettleState(String settleState) {
        this.settleState = settleState;
    }

    public String getSecondSettleState() {
        return secondSettleState;
    }

    public AzEncourage secondSettleState(String secondSettleState) {
        this.secondSettleState = secondSettleState;
        return this;
    }

    public void setSecondSettleState(String secondSettleState) {
        this.secondSettleState = secondSettleState;
    }

    public String getRemark() {
        return remark;
    }

    public AzEncourage remark(String remark) {
        this.remark = remark;
        return this;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Instant getGmtModified() {
        return gmtModified;
    }

    public AzEncourage gmtModified(Instant gmtModified) {
        this.gmtModified = gmtModified;
        return this;
    }

    public void setGmtModified(Instant gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getModifiedUser() {
        return modifiedUser;
    }

    public AzEncourage modifiedUser(String modifiedUser) {
        this.modifiedUser = modifiedUser;
        return this;
    }

    public void setModifiedUser(String modifiedUser) {
        this.modifiedUser = modifiedUser;
    }

    public Instant getGmtCreate() {
        return gmtCreate;
    }

    public AzEncourage gmtCreate(Instant gmtCreate) {
        this.gmtCreate = gmtCreate;
        return this;
    }

    public void setGmtCreate(Instant gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getCreateUser() {
        return createUser;
    }

    public AzEncourage createUser(String createUser) {
        this.createUser = createUser;
        return this;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getAdd1() {
        return add1;
    }

    public AzEncourage add1(String add1) {
        this.add1 = add1;
        return this;
    }

    public void setAdd1(String add1) {
        this.add1 = add1;
    }

    public String getAdd2() {
        return add2;
    }

    public AzEncourage add2(String add2) {
        this.add2 = add2;
        return this;
    }

    public void setAdd2(String add2) {
        this.add2 = add2;
    }

    public String getAdd3() {
        return add3;
    }

    public AzEncourage add3(String add3) {
        this.add3 = add3;
        return this;
    }

    public void setAdd3(String add3) {
        this.add3 = add3;
    }

    public String getAdd4() {
        return add4;
    }

    public AzEncourage add4(String add4) {
        this.add4 = add4;
        return this;
    }

    public void setAdd4(String add4) {
        this.add4 = add4;
    }

    public String getAdd5() {
        return add5;
    }

    public AzEncourage add5(String add5) {
        this.add5 = add5;
        return this;
    }

    public void setAdd5(String add5) {
        this.add5 = add5;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AzEncourage azEncourage = (AzEncourage) o;
        if (azEncourage.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), azEncourage.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "AzEncourage{" +
            "id=" + getId() +
            ", encourageId='" + getEncourageId() + "'" +
            ", productType='" + getProductType() + "'" +
            ", encourageAmounts='" + getEncourageAmounts() + "'" +
            ", encourageDesc='" + getEncourageDesc() + "'" +
            ", encourageImportDate='" + getEncourageImportDate() + "'" +
            ", encourageCreate='" + getEncourageCreate() + "'" +
            ", encourageType='" + getEncourageType() + "'" +
            ", encourageSecondType='" + getEncourageSecondType() + "'" +
            ", encourageBudget='" + getEncourageBudget() + "'" +
            ", responsibilityClass='" + getResponsibilityClass() + "'" +
            ", responsibilitySmallClass='" + getResponsibilitySmallClass() + "'" +
            ", responsibilityTime='" + getResponsibilityTime() + "'" +
            ", tradeCode='" + getTradeCode() + "'" +
            ", orderCode='" + getOrderCode() + "'" +
            ", pjOrderCode='" + getPjOrderCode() + "'" +
            ", sourceOrderCode='" + getSourceOrderCode() + "'" +
            ", originalOrderCode='" + getOriginalOrderCode() + "'" +
            ", sourceNameCode='" + getSourceNameCode() + "'" +
            ", encourageObject='" + getEncourageObject() + "'" +
            ", encourageSecondObject='" + getEncourageSecondObject() + "'" +
            ", proportion=" + getProportion() +
            ", sourceSystem='" + getSourceSystem() + "'" +
            ", netpoint='" + getNetpoint() + "'" +
            ", settleState='" + getSettleState() + "'" +
            ", secondSettleState='" + getSecondSettleState() + "'" +
            ", remark='" + getRemark() + "'" +
            ", gmtModified='" + getGmtModified() + "'" +
            ", modifiedUser='" + getModifiedUser() + "'" +
            ", gmtCreate='" + getGmtCreate() + "'" +
            ", createUser='" + getCreateUser() + "'" +
            ", add1='" + getAdd1() + "'" +
            ", add2='" + getAdd2() + "'" +
            ", add3='" + getAdd3() + "'" +
            ", add4='" + getAdd4() + "'" +
            ", add5='" + getAdd5() + "'" +
            "}";
    }
}
